/**
 * Created by Administrator on 2018/3/8.
 */
// 动态设置内容高度
function setSectionHeight() {
    var screenHeight = window.screen.height;
    var bodyHeight = document.body.scrollHeight;
    console.log(screenHeight);
    console.log(bodyHeight);
    if (screenHeight > bodyHeight) {
        var section = document.querySelector("#app");
        section.style.height = screenHeight + 'px';
    }
}

Vue.component('v-footer', {
    template: ' <footer><div class="copy"><p class="text">© 2018 - 重庆市地理信息中心</p></div></footer>'
});

Vue.component("loading", {
    template: '<div class="p-fixed z-1000" v-show="isShow"><p>{{mes}}</p> <mt-spinner :type="0"></mt-spinner> </div>',
    props: ['isShow'],
    data() {
        return {
            mes: "如果是"
        }
    },
    methods: {},
    created() {
        console.log('loading');
    },
    mounted() {

    }

});

function getDateTime(value) {
    var y = value.getFullYear();
    var m = value.getMonth() + 1 > 9 ? value.getMonth() + 1 : '0' + (value.getMonth() + 1);
    var d = value.getDay() > 9 ? value.getDay() : '0' + value.getDay();
    var h = value.getHours() > 9 ? value.getHours() : '0' + value.getHours();
    var mi = value.getMinutes() > 9 ? value.getMinutes() : '0' + value.getMinutes();
    return y + '-' + m + '-' + d + ' ' + h + ':' + mi;

}

function getDateCustom(value) {
    var y = value.getFullYear();
    var m = value.getMonth() + 1 > 9 ? value.getMonth() + 1 : '0' + (value.getMonth() + 1);
    var d = value.getDay() > 9 ? value.getDay() : '0' + value.getDay();
    return y + '-' + m + '-' + d

}

// 新闻列表组件
Vue.component('v-new-list', {
    template: '<div v-if="newList.length>0">' +
    '<div class="item" v-for="(item,index) in newList" :key="index">' +
    '<h2 class="title" v-text="item.title"></h2>' +
    '<div class="item-item">' +
    '发布人：<span class="text" v-text="item.publisher"></span>' +
    '更新时间： <span class="text" v-text="item.updateTime"></span>' +
    '</div>' +
    '</div>' +
    '</div>',
    props: ['newList'],
    data() {
        return {}
    },
    methods: {}
});

// 已完成工作组件
Vue.component('v-work-done', {
    template: '<div class="have-data" v-if="workList.length>0">' +
    '<div class="item" v-for="(item,index) in workList">' +
    '<div class="work-name">' +
    '<span class="f-w-600 title" v-text="item.workName"></span>' +
    '<span class="status" v-text="statusCode[item.workStatus]"></span>' +
    '</div>' +
    '<div class="author font-12 item-item">' +
    '<span class="label d-i-block">发起人</span>' +
    '<span class="c-666" v-text="item.author"></span>' +
    '</div>' +
    '<div class="send-time font-12 item-item">' +
    '<span class="label d-i-block">到达时间</span>' +
    '<span class="c-666" v-text="item.sendTime"></span>' +
    '</div>' +
    '<div class="start-time font-12 item-item">' +
    '<span class="label d-i-block">办理时间</span>' +
    '<span class="c-666" v-text="item.startTime"></span>' +
    '</div>' +
    '<div class="type font-12 item-item">' +
    '<span class="label d-i-block">办理方式</span>' +
    '<span class="c-666 item-type" v-text="typeCode[item.type]"></span>' +
    '</div>' +
    '<div class="start-time font-12 item-item">' +
    '<span class="label d-block">任务信息</span>' +
    '<p class="c-666" v-text="item.workInfo"></p>' +
    '</div>' +
    '</div>' +
    '</div>',
    props: ['workList'],
    data() {
        return {
            statusCode: ["已提交", "已完成", "已终止"],
            typeCode: ["已提交", "被终止"]
        }
    },
    methods: {}
});

// 未完成工作组件
Vue.component('v-wait-work', {
    template: '<div class="item">' +
    '<div class="top">' +
    '<div class="left">' +
    '<p class="title">任务类别</p>' +
    '<p class="text type" v-text="waitList.type"></p>' +
    '<p class="title">任务信息</p>' +
    '<p class="text info" v-text="waitList.title"></p>' +
    '</div>' +
    '<div class="right">' +
    '<button class="btn" @click="doit(waitList)">处理</button>' +
    '</div>' +
    '</div>' +
    '<div class="time">' +
    '<span v-text="waitList.time"></span>' +
    '</div>' +
    '</div>',
    props:['waitList'],
    methods:{
        doit(waitList) {
            console.log(waitList.id);
        }
    }
});

// 会议组件

